package panda.query.condition;

import panda.query.scan.Scanner;
import panda.query.struct.Attribute;
import panda.query.struct.Constant;
import panda.record.Schema;
import panda.transaction.Transaction;

public class ConstValue implements ValueExpression {
	Constant value;
	
	public ConstValue(Constant value) {
		this.value = value;
	}

	public Constant evaluate(Scanner s, Transaction tx) {
		return value;
	}

	public boolean dominates(Attribute attr) {
		return false;
	}

	public boolean isConstant() {
		return true;
	}

	public Constant asConstant() {
		if (isConstant())
			return evaluate(null, null);
		else
			return null;
	}

	public boolean appliesTo(Schema sch) {
		return true;
	}

	

}
